/**
 * 
 */
package com.sofast.common;

import java.sql.Connection;
import java.sql.DriverManager;


/**
 * @author alex
 *
 */
public class DBConfig {

	public static final String MYSQL 	= "org.gjt.mm.mysql.Driver";
	public static final String url = "jdbc:mysql://127.0.0.1:3306/sofast_music?user=root&password=root";
	private static Connection conn;
	
	public static Connection getConn(){
		if(conn == null) {
			try {
				Class.forName(DBConfig.MYSQL);
				String url = DBConfig.url;
				conn = DriverManager.getConnection(url);
				
			}catch (Exception e) {
				e.printStackTrace();
			}
		}
		return conn;
	}
}
